using System.Collections.Generic;
using Jaws.Core.Web;
using Jaws.Core.Web.Entities;
using Jaws.Core.Web.Entities.Comments;
using Jaws.Core.Web.Entities.Validation.CustomAttributes;

namespace Jaws.Core.Web.Entities.Recipes
{
    [XmlDataDirectory("recipes")]
    public class Recipe : XmlBusinessBase<Recipe>, ICommentable
    {
        public Recipe()
        {
            Ingredients = new List<string>();
        }

        [NotNullOrEmpty]
        public string Name { get; set; }

        [IsRequired]
        public List<string> Ingredients { get; set; }

        [MinLength(10)]
        [NotNullOrEmpty]
        public string Instructions { get; set; }

        #region Implementation of ICommentable

        public CommentsCollection Comments { get; set; }

        #endregion
    }
}